<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>登陆</title>
    <link href="${pageContext.servletContext.contextPath }/resources/css/login.css" rel="stylesheet" type="text/css" />
    <script src="${pageContext.servletContext.contextPath }/resources/js/jquery-1.11.0.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        if (window.top!=window.self) {
            window.top.location=window.location;
        }
    </script>
</head>


<body>
<div class="bg">
    <div class="login">权限管理系统</div>
    <form id="login_form" action="${pageContext.servletContext.contextPath}/login" method="post">
        <table width="375" height="100" border="0">
            <tr>
                <td class="login_name">用户名：</td>
                <td><input name="username" id="username" type="text" class="login_input" value="${acc.username}"  tabindex="1"/></td>
                <td rowspan="3" ><input value="" name="ssss" type="submit" class="bnt_1" tabindex="4"/></td>
            </tr>
            <tr>
                <td class="login_name">密&nbsp;&nbsp;&nbsp;码：</td>
                <td><input name="password" id="password" type="password" class="login_input" tabindex="2"/></td>
            </tr>
            <tr>
                <td  class="login_name">验证码：</td>
                <td><input id="safecode" name="safecode" value="" type="text" class="yzm" tabindex="3"/><img id="safecode_img" src="${pageContext.servletContext.contextPath}/servlet/ImageServlet" height="28px" width="94px" style="cursor: pointer;" class="yzmImg" onclick="reloadVerifyCode();"/>
                </td>
            </tr>
            <tr>
                <td id="login_error" colspan="2"  style="font-weight: bolder;">
                    <br/>
                    <noscript><b style="color:red">对不起，你的游览器禁用了JavaScript!无法登录</b></noscript>
                </td>
            </tr>
        </table>
    </form>
</div>

<div class="footer">建议使用IE 8.0+、谷歌浏览器、火狐浏览器访问本网站<br/><br/></div>
</body>
<script type="text/javascript">

    // 重载验证码
    function reloadVerifyCode(){
        var timenow = new Date().getTime();
        var safe_code_img =  $("#safecode_img").get(0);
        safe_code_img.src="${pageContext.servletContext.contextPath}/servlet/ImageServlet?d=" + timenow;
    }

    $("#login_form").submit(function(form){
        var userName = $("#username").val();
        var userPassword = $("#password").val();
        if($.trim(userName)=="" || $.trim(userPassword)==""){
            alert("用户名或密码不能为空");
            return false;
        }
        form.submit();
    });
</script>
</html>
